<%@ taglib prefix="html" uri="http://struts.apache.org/tags-html"%>
<%@ taglib prefix="bean" uri="http://struts.apache.org/tags-bean"%>
<%@ taglib prefix="logic" uri="http://struts.apache.org/tags-logic"%>
<%@ taglib prefix="core" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="display" uri="http://displaytag.sf.net"%>
<%@ page contentType="text/html;charset=UTF-8" language="java"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="id" lang="id">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title></title>
</head>
<body>
	<html:form action="/interviewList.do">
	<div class="outerbox">
		<div class="mainHeading">
			<div class=""
				style="width: 280px; height: 32px; background: url(images/formTitleBackground.png) no-repeat top right; font-color: #CC0000;">
				<h2 class="formTitle">INTERVIEWS</h2>
			</div>
		</div>
		<div class="searchbox"> 
				<div id="formcontent">
					<br class="clear" />
					<table style="width: 100%; min-width: 980px; padding-bottom: 10px;">
						<tr>
							<td class="txtLabel"><label>Name</label></td>
							<td>
								<html:text property="nameKeyWord" style="width:200px;"></html:text>
							</td>
							<td class="txtLabel"><label>Candidate</label></td>
							<td>
								<html:select property="selectedCandidate" style="width:200px;">
									<html:optionsCollection property="allCandidates" label="label" value="value" />
								</html:select>
							</td>
							<td class="txtLabel"><label>Vacancy</label></td>
							<td>
								<html:select property="selectedVacancy" style="width:200px;">
									<html:optionsCollection property="allVacancies" label="label" value="value" />
								</html:select>
							</td>
						</tr>
						<tr>
							<td class="txtLabel"><label>Interviewer</label></td>
							<td>
								<html:text styleId="employeeTextBoxId" property="interviewer" style="width:200px;"  onkeyup="retrieveURL('employeeAjax', 'employeeTextBoxId');"></html:text>
							</td>
						</tr>
					</table>
				</div>
				<div class="actionbar_form" style="border-top: 2px solid #191919;">
					<div class="actionbuttons">
						<html:submit styleClass="plainbtn" value="Search">Search</html:submit> 
						<html:reset styleClass="plainbtn">Reset</html:reset>
					</div>
				</div>
				<br class="clear" />
		</div>
	</div>

	<!--   ==================================== TABLE ======================================    -->

	<div class="outerbox"> 
			<div class="actionbar_table">
				<div class="formbuttons">
					<logic:equal name="interviewList" value="true" property="canAdd">
						<input type="button" class="plainbtn" id="btnAdd" name="btnAdd" value="Add"  onclick="openPopup('interviewUpdate.do?act=add','Add Interview','520px','500px')"></input>
					</logic:equal>
					<logic:equal name="interviewList" value="true" property="canDelete">
						<html:submit disabled="true" styleClass="plainbtn" styleId="btnDelete" property="btnDelete" value="Delete" onclick="return confirmButton('btnDelete=clicked','Are you sure you want to delete all the selected items?')"></html:submit>
					</logic:equal>
						Found&nbsp;<bean:write name="interviewList" property="totalItems"/>&nbsp;items /&nbsp;<bean:write name="interviewList" property="totalPage"/>&nbsp;pages.
				</div>

				<br class="clear" />
			</div>
			<br class="clear" />

			<div id="helpText" class="helpText"></div>

			<table
				style="border-collapse: collapse; width: 100%; text-align: left;"
				class="data-table">
				<colgroup align="right">
					<col width="1%" />
					<col width="13%" />
					<col width="8%" />
					<col width="7%" />
					<col width="7%" />
					<col width="5%" />
					<col width="5%" />
					<col width="13%" />
					<col width="3%" />
					<col width="3%" />
				</colgroup>

				<thead>
					<tr>
						<logic:equal name="interviewList" value="true" property="canDelete">
							<th rowspan="1"><input type="checkbox" id="checkAll"  onclick="setCheckAll()" name="chkSelectAll" value=""/></th>
						</logic:equal>
						<logic:notEqual name="interviewList" value="true" property="canDelete">
							<th rowspan="1"></th>
						</logic:notEqual>
						<th style="text-align: left" rowspan="1"><a href="interviewList.do?sort=interviewName" title="Sort by Interview Name" class="null">Interview</a></th>
						<th style="text-align: left" rowspan="1"><a href="interviewList.do?sort=vacancyName" title="Sort by Vacancy Name" class="null">Vacancy</a></th>
						<th style="text-align: left" rowspan="1"><a href="interviewList.do?sort=candidateName" title="Sort by Candidate Name" class="null">Candidate</a></th>
						<th style="text-align: left" rowspan="1"><a href="interviewList.do?sort=interviewTime" title="Sort by Interview Time" class="null">Date Time</a></th>
						<th style="text-align: left" rowspan="1"><a href="interviewList.do?sort=status" title="Sort by Status" class="null">Status</a></th>
						<th style="text-align: left" rowspan="1"><a href="interviewList.do?sort=result" title="Sort by Result" class="null">Result</a></th>
						<th style="text-align: left" rowspan="1"><a href="interviewList.do?sort=interviewers" title="Sort by Interviewers" class="null">Interviewers</a></th>
						<th style="text-align: left; color: white;" rowspan="1">Attachment</th>
						<th style="text-align: left; color: white;" rowspan="1">Employ</th>
					</tr>
				</thead>

				<tbody>					
					<logic:iterate id="allInterviews" name="interviewList" property="allInterviews" scope="session" indexId="counter">
						<tr class='<%= counter.intValue()%2 == 0 ? "even" : "odd" %>' >
							<logic:equal name="interviewList" value="true" property="canDelete">
								<td class="left"><html:checkbox styleClass="tableCheckBox" onclick="disableCheckAll()" name="allInterviews" property="isSelected" indexed="true"/></td>
							</logic:equal>
							<logic:notEqual name="interviewList" value="true" property="canDelete">
								<td class="left"></td>
							</logic:notEqual>
							<logic:notEqual name="allInterviews" value="Closed" property="status">
								<td class="left"><a href="javascript:openPopup('interviewUpdate.do?act=edit&id=<bean:write name="allInterviews" property="id"/>','Edit Interview','520px','500px')"><bean:write name="allInterviews" property="interviewName"/></a></td>
							</logic:notEqual>
							<logic:equal name="allInterviews" value="Closed" property="status">
								<td class="left"><bean:write name="allInterviews" property="interviewName"/></td>
							</logic:equal>
							<td class="left"><a href="vacancyUpdate.do?id=<bean:write name="allInterviews" property="vacId"/>"><bean:write name="allInterviews" property="vacancyName"/></a></td>
							<td class="left"><a href="candidateUpdate.do?id=<bean:write name="allInterviews" property="canId"/>"><bean:write name="allInterviews" property="candidateName"/></a></td>
							<td class="left"><bean:write name="allInterviews" property="interviewTime"/></td>
							<td class="left"><bean:write name="allInterviews" property="status"/></td>
							<td class="left"><bean:write name="allInterviews" property="result"/></td>
							<td class="left"><bean:write name="allInterviews" property="interviewers"/></td>
							<td class="left"><a href="InterviewAttachment?id=<bean:write name="allInterviews" property="id"/>">Download</a></td>
							<logic:equal name="allInterviews" value="Interviewed" property="status">
								<td class="left"><a href="javascript:openPopup('employ.do?id=<bean:write name="allInterviews" property="canId"/>&intId=<bean:write name="allInterviews" property="id"/>', 'Employ Candidate','500px','200px')">Employ</a></td>
							</logic:equal>
							<logic:notEqual name="allInterviews" value="Interviewed" property="status">
								<td class="left"></td>
							</logic:notEqual>
						</tr>
					</logic:iterate>
				</tbody>
			</table>

			<div id="pageListId" style="margin-right: 10px;margin-bottom: 4px;margin-top: 4px;">
				<logic:iterate id="pageListId" name="interviewList" property="listPages" indexId="counter">
					<logic:equal name="pageListId" value="false" property="isCurrent">
						<td><a style="color: black; font-weight: bold; margin-left: 5px; font-size: 12px;" href="interviewList.do?page=<bean:write name="pageListId" property="value"/>"><bean:write name="pageListId" property="label"/></a></td>
					</logic:equal>
					<logic:notEqual name="pageListId" value="false" property="isCurrent">
						<td><a style="color: red; font-weight: bold; margin-left: 5px; font-size: 13px;"><bean:write name="pageListId" property="label"/></a></td>
					</logic:notEqual>
				</logic:iterate>
			</div>  
	</div>
	</html:form>
</body>
</html>